/**
@file
	ConfigImpl.cpp
@brief

@author
	GengYong
@revision
	2005/11/05 * Created by GengYong.
*/

#include "ConfigImpl.h"

using namespace SAF;


const char * ConfigImpl::s_emptystring = "";

ConfigImpl::ConfigImpl()
{
	PERFCOUNTER("ConfigImpl::ConfigImpl");
	return;
}

ConfigImpl::~ConfigImpl()
{
	PERFCOUNTER("ConfigImpl::~ConfigImpl");
	return;
}

bool ConfigImpl::Load(const char *)
{
	PERFCOUNTER("ConfigImpl::Load");
	return false;
}

bool ConfigImpl::Save(const char *)
{
	PERFCOUNTER("ConfigImpl::Save");
	return false;
}

bool ConfigImpl::SetValue(const char * name, const char * value)
{
	PERFCOUNTER("ConfigImpl::SetValue");

	m_valmap[std::string(name)] = std::string(value);
	return true;
}

const char * ConfigImpl::GetValue(const char * name) const
{
	PERFCOUNTER("ConfigImpl::GetValue");

	std::map<std::string, std::string>::const_iterator point = m_valmap.find(std::string(name));
	if (point != m_valmap.end())
	{
		return point->second.c_str();
	}
	return ConfigImpl::s_emptystring;
}



